package com.vhuomai.product.constant;

import com.vhuomai.product.validator.StringValidator;
import com.vhuomai.product.validator.Validator;

/**
 * @author harris
 */
public enum SpuItemType {
    STRING(false, new StringValidator()),
    TEXTAREA(false, new StringValidator()),
    BOOLEAN(false, new StringValidator()),
    INTEGER(false, new StringValidator()),
    DECIMAL(false, new StringValidator()),
    DATE(false, new StringValidator()),
    DATETIME(false, new StringValidator()),
    TIME(false, new StringValidator()),
    DATE_RANGE(false, new StringValidator()),
    DATETIME_RAGE(false, new StringValidator()),
    TIME_RAGE(false, new StringValidator()),
    RADIO(true, new StringValidator()),
    SELECT(true, new StringValidator()),
    CHECKBOX(true, new StringValidator());

    private boolean multiple;
    private Validator validator;

    SpuItemType(boolean multiple, Validator validator) {
        this.multiple = multiple;
        this.validator = validator;
    }

    public boolean isMultiple() {
        return this.multiple;
    }

    public Validator validator() {
        return this.validator;
    }
}
